#ifndef YCSB_C_XJB_DB_H_
#define YCSB_C_XJB_DB_H_

#include "core/db.h"

#include <iostream>
#include <string>
#include <mutex>
#include "core/properties.h"

using std::cout;
using std::endl;
namespace ycsbc {

class XJBDB:public DB{
    public:
    void Init(){
        std::lock_guard<std::mutex> lock(mutex_);
        cout<<"A XJB database is inited";
    }

    int Read(const std::string &table, const std::string &key,
           const std::vector<std::string> *fields,
           std::vector<KVPair> &result);

  int Scan(const std::string &table, const std::string &key,
           int len, const std::vector<std::string> *fields,
           std::vector<std::vector<KVPair>> &result) {
    std::lock_guard<std::mutex> lock(mutex_);
    //cout << "SCAN " << endl;
    return 0;
  }

  int Update(const std::string &table, const std::string &key,
             std::vector<KVPair> &values);

  int Insert(const std::string &table, const std::string &key,
             std::vector<KVPair> &values) {
    Update(table,key,values);
    return 0;
  }

  int Delete(const std::string &table, const std::string &key) {
    std::lock_guard<std::mutex> lock(mutex_);
    cout << "DELETE " << endl;
    return 0; 
  }

 private:
  std::mutex mutex_;
};

}

#endif
